<?php
/**
 * 格式化点赞
 */
function format_praise($count, $max = 999, $fill = '+', $default = '点赞')
{
    $count = intval($count);
    if ($count <= 0) {
        return $default;
    } elseif ($count <= $max) {
        return "$count";
    } else {
        return $max . $fill;
    }
}

/**
 * url GET查询字符串拼接
 * @param       $url
 * @param array $vars
 * @return string
 */
function query_url($url, $vars = array())
{
    $get = $_GET;
    unset($get['p'], $get['m'], $get['c'], $get['a']);
    return U($url, array_merge($get, $vars));
}



